<?php
$xhtmlbuttons = new create_buttons();
if($getpath == ""){
    // empty
}else {
    $backer = $getpath;
    $zahler = (strlen($backer)-1);
    $backer{$zahler};
    preg_match_all('/\//', $backer, $matches);
    $treffer = count($matches);
    if($backer{$zahler}=="/" && $treffer>=1){
        $backer{$zahler} == "";
        $getpathteile = explode("/",$backer);
        foreach($getpathteile as $gpteil_tmp){
            if($gpteil_tmp != ""){
                $gpteile[] = $gpteil_tmp;
            } else {}
        }
        if (count($gpteile) > 1){
            $backpath = "?path=";
            for($i=0;$i<count($gpteile)-1;$i++){
                $backpath .= $gpteile[$i]."/";
            }
        }
        // explode getpath und setze neu zusammen
        // wenn nur ein sprung kein path
    }
$xhtmlbuttons->make_button("index.php","img/rootdir.gif",ROOTDIR);
$xhtmlbuttons->make_button("index.php".$backpath,"img/folderup.gif",FOLDERUP);
$xhtmlbuttons->make_spacer();
}
$xhtmlbuttons->make_formbutton("img/cut.gif",CUT,"cut");
$xhtmlbuttons->make_formbutton("img/copy.gif",COPY,"copy");
if($_SESSION['dirs']>0 || $_SESSION['files']>0){
    $xhtmlbuttons->make_formbutton("img/paste.gif",PASTE,"paste");
}
$xhtmlbuttons->make_formbutton("img/delete.gif",DEL,"delete");
$xhtmlbuttons->make_spacer();
if($_SESSION['dirs']>0 || $_SESSION['files']>0){
    $xhtmlbuttons->make_formbutton("img/delclip.gif",DELCLIP,"delclip");
    $xhtmlbuttons->make_spacer();
}
$xhtmlbuttons->make_formbutton("img/edit.gif",EDIT,"edit");
$xhtmlbuttons->make_formbutton("img/chmod.gif",CHM_OD,"chmod");
$xhtmlbuttons->make_spacer();
$xhtmlbuttons->make_formbutton("img/newfile.gif",NEWFILE,"newfile");
$xhtmlbuttons->make_formbutton("img/newfolder.gif",NEWFOLD,"newfolder");
$xhtmlbuttons->make_spacer();
$xhtmlbuttons->make_formbutton("img/unzip.gif",UNZIP,"unzip");
if($zip == "RW"){
    $xhtmlbuttons->make_formbutton("img/zip.gif",ZIP,"zip");
}
$xhtmlbuttons = rtrim($xhtmlbuttons->buttonxhtml);